<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	template="../include/template.xhtml">
	<ui:define name="pageTitle">
		<h:outputText value="作品" />
	</ui:define>
	<ui:define name="logoTitle">
		<h:outputText value="作品" />
	</ui:define>	
	<ui:define name="content">
		<style type="text/css">
<!--
.backGroudClass {
	width: 100%;
	height: 100%;
	margin: 0;
	border: 1px solid #6699CC;
}
-->
</style>


		<rich:spacer height="4px" />
		<a:form style="margin:0">
			<rich:simpleTogglePanel switchType="client" label="分类"
				style="width:29%;height:300px;float: left;"
				headerClass="headerClass">
				<a:repeat value="#{categoryAction.getCategoriesByLevel(1)}"
					var="category">
					<h:outputText value="+ " />
					<a:commandLink value="#{category.name}" styleClass="strong"
						action="#{providerAction.searchSubCategory(category.name)}" />
					<h:panelGrid columns="2" style="padding:0;margin:0">
						<a:repeat value="#{category.children}" var="child">
							<a:commandLink value="#{child.name},"
								action="#{providerAction.searchSubCategory(child.name)}" />
						</a:repeat>
					</h:panelGrid>
				</a:repeat>
			</rich:simpleTogglePanel>

			<rich:simpleTogglePanel switchType="client"
				style="width:70%;height:300px;float: right;"
				headerClass="headerClass">
				<f:facet name="header">
					<h:outputText value="热门作品推荐" />
				</f:facet>
				<rich:dataGrid value="#{opusShowAction.allOpuses}" columns="4"
					elements="4" var="vopus" style="text-align:center;"
					styleClass="dataGridClass">
					<h:outputLink value="../upload/opus/#{vopus.imageUrl}">
						<h:graphicImage title="#{vopus.topic}" style="border:0;"
							value="/upload/opus/small_#{vopus.imageUrl}" />
					</h:outputLink>
					<h:panelGrid columns="2" style="margin:0 auto;">
						<h:outputText value="作者:" />
						<s:link value="#{vopus.owner.nickName}"
							view="/wike/viewDetail.xhtml" title="#{vopus.owner.nickName}">
							<f:param name="userId" value="#{vopus.owner.id}" />
						</s:link>
						<h:outputText value="类别:" />
						<h:outputText value="#{vopus.category.name}" />
					</h:panelGrid>

				</rich:dataGrid>
			</rich:simpleTogglePanel>
		</a:form>
		<div style="clear: both;"></div>
		<rich:spacer height="4px" />
		<rich:simpleTogglePanel switchType="client" style="width:99.6%;"
			headerClass="headerClass">
			<f:facet name="header">
				<h:outputText value="作品展示" />
			</f:facet>
			<rich:dataGrid value="#{opusShowAction.allOpuses}" columns="4"
				elements="20" var="vopus"
				style="border-style:none;width:100%;text-align:center;">

				<h:outputLink value="../upload/opus/#{vopus.imageUrl}">
					<h:graphicImage title="#{vopus.topic}" style="border:0;"
						value="/upload/opus/small_#{vopus.imageUrl}" />
				</h:outputLink>
				<h:panelGrid columns="2" style="margin:0 auto;">
					<h:outputText value="作者:" />
					<s:link value="#{vopus.owner.nickName}"
						view="/wike/viewDetail.xhtml" title="#{vopus.owner.nickName}">
						<f:param name="userId" value="#{vopus.owner.id}" />
					</s:link>
					<h:outputText value="类别:" />
					<h:outputText value="#{vopus.category.name}" />
				</h:panelGrid>

			</rich:dataGrid>
		</rich:simpleTogglePanel>
	</ui:define>
</ui:composition>
